{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "b4fb0c3c-e7fd-48ba-b06a-d2e2adf7146d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "        tconst title_type                    primary_title  \\\n",
      "0    tt0011462      movie                Midsummer Madness   \n",
      "1    tt0026714      movie        A Midsummer Night's Dream   \n",
      "2    tt0033864      movie  The Teachers on Summer Vacation   \n",
      "3    tt0037325      movie                     Summer Storm   \n",
      "4    tt0038406      movie                Centennial Summer   \n",
      "..         ...        ...                              ...   \n",
      "900  tt9382076      movie                      Summer Love   \n",
      "901  tt9430712      movie  Let the Summer Never Come Again   \n",
      "902  tt9530420      movie                   Goodbye Summer   \n",
      "903  tt9716208      movie                   Summer of Mesa   \n",
      "904  tt9842874      movie  Nothing Left - Just That Summer   \n",
      "\n",
      "                         original_title    year  runtime_minutes  \\\n",
      "0                     Midsummer Madness  1920.0             60.0   \n",
      "1             A Midsummer Night's Dream  1935.0            133.0   \n",
      "2              Magistrarna på sommarlov  1941.0             86.0   \n",
      "3                          Summer Storm  1944.0            106.0   \n",
      "4                     Centennial Summer  1946.0            102.0   \n",
      "..                                  ...     ...              ...   \n",
      "900                         Summer Love  2019.0              NaN   \n",
      "901   Lass den Sommer nie wieder kommen  2017.0            202.0   \n",
      "902                      Goodbye Summer  2019.0             67.0   \n",
      "903                      Summer of Mesa  2020.0             76.0   \n",
      "904  Ein wilder Sommer - Die Wachausaga  2018.0            154.0   \n",
      "\n",
      "                     genres                     simple_title  average_rating  \\\n",
      "0                     Drama                midsummer madness             7.4   \n",
      "1    Comedy,Fantasy,Romance         a midsummer nights dream             6.8   \n",
      "2                    Comedy  the teachers on summer vacation             5.5   \n",
      "3     Crime,Drama,Film-Noir                     summer storm             6.6   \n",
      "4     History,Music,Romance                centennial summer             6.1   \n",
      "..                      ...                              ...             ...   \n",
      "900                 Romance                      summer love             7.5   \n",
      "901                   Drama  let the summer never come again             6.2   \n",
      "902           Drama,Romance                   goodbye summer             5.6   \n",
      "903           Drama,Romance                   summer of mesa             5.5   \n",
      "904    Comedy,Drama,History   nothing left  just that summer             4.4   \n",
      "\n",
      "     num_votes  \n",
      "0           19  \n",
      "1         3931  \n",
      "2           78  \n",
      "3          688  \n",
      "4          431  \n",
      "..         ...  \n",
      "900         17  \n",
      "901         98  \n",
      "902         79  \n",
      "903        114  \n",
      "904         15  \n",
      "\n",
      "[905 rows x 10 columns]\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "data = pd.read_csv(r\"C:\\Users\\Lenovo\\Desktop\\summer_movies.csv\")\n",
    "print(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "8985b0d1-02ca-4801-864a-8f2c29bb8355",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Year 1920.0: 1\n",
      "Year 1928.0: 1\n",
      "Year 1935.0: 1\n",
      "Year 1941.0: 1\n",
      "Year 1944.0: 2\n",
      "Year 1946.0: 2\n",
      "Year 1947.0: 1\n",
      "Year 1948.0: 1\n",
      "Year 1949.0: 1\n",
      "Year 1950.0: 1\n",
      "Year 1951.0: 4\n",
      "Year 1953.0: 1\n",
      "Year 1954.0: 2\n",
      "Year 1955.0: 5\n",
      "Year 1956.0: 3\n",
      "Year 1957.0: 3\n",
      "Year 1958.0: 4\n",
      "Year 1959.0: 7\n",
      "Year 1960.0: 2\n",
      "Year 1961.0: 6\n",
      "Year 1962.0: 1\n",
      "Year 1963.0: 4\n",
      "Year 1964.0: 2\n",
      "Year 1965.0: 3\n",
      "Year 1966.0: 2\n",
      "Year 1967.0: 6\n",
      "Year 1968.0: 10\n",
      "Year 1969.0: 6\n",
      "Year 1970.0: 7\n",
      "Year 1971.0: 9\n",
      "Year 1972.0: 8\n",
      "Year 1973.0: 6\n",
      "Year 1974.0: 4\n",
      "Year 1975.0: 2\n",
      "Year 1976.0: 6\n",
      "Year 1977.0: 6\n",
      "Year 1978.0: 9\n",
      "Year 1979.0: 6\n",
      "Year 1980.0: 4\n",
      "Year 1981.0: 9\n",
      "Year 1982.0: 9\n",
      "Year 1983.0: 6\n",
      "Year 1984.0: 7\n",
      "Year 1985.0: 8\n",
      "Year 1986.0: 6\n",
      "Year 1987.0: 7\n",
      "Year 1988.0: 14\n",
      "Year 1989.0: 9\n",
      "Year 1990.0: 7\n",
      "Year 1991.0: 4\n",
      "Year 1992.0: 10\n",
      "Year 1993.0: 8\n",
      "Year 1994.0: 9\n",
      "Year 1995.0: 3\n",
      "Year 1996.0: 13\n",
      "Year 1997.0: 11\n",
      "Year 1998.0: 9\n",
      "Year 1999.0: 14\n",
      "Year 2000.0: 13\n",
      "Year 2001.0: 17\n",
      "Year 2002.0: 13\n",
      "Year 2003.0: 14\n",
      "Year 2004.0: 14\n",
      "Year 2005.0: 10\n",
      "Year 2006.0: 26\n",
      "Year 2007.0: 21\n",
      "Year 2008.0: 33\n",
      "Year 2009.0: 24\n",
      "Year 2010.0: 22\n",
      "Year 2011.0: 24\n",
      "Year 2012.0: 20\n",
      "Year 2013.0: 30\n",
      "Year 2014.0: 28\n",
      "Year 2015.0: 32\n",
      "Year 2016.0: 28\n",
      "Year 2017.0: 35\n",
      "Year 2018.0: 32\n",
      "Year 2019.0: 29\n",
      "Year 2020.0: 29\n",
      "Year 2021.0: 19\n",
      "Year 2022.0: 32\n",
      "Year 2023.0: 32\n",
      "Year 2024.0: 14\n"
     ]
    }
   ],
   "source": [
    "df = pd.DataFrame(data)\n",
    "year_counts = df.groupby(\"year\")[\"original_title\"].count()\n",
    "for year, count in year_counts.items():\n",
    "    print(f\"Year {year}: {count}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "131d4652-9e90-49a7-986b-dafb051256f4",
   "metadata": {},
   "outputs": [],
   "source": [
    "result_df = year_counts.reset_index(name=\"Count\")\n",
    "result_df.to_csv(\"year_count.csv\", index=False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "myenv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
